cimport numpy

cdef extern from "math.h":
    double sqrt(double)
    double ceil(double)

cdef class Vec:
    """
    Class to represent Vector in 3D.
    """
    cdef public double x
    cdef public double y
    cdef public double z
    
    cpdef Vec mul(self, double m)
    cpdef richcmp(Vec self,Vec p,int oper)
    cpdef Vec iadd(Vec self, Vec p)
    cpdef Vec isub(Vec self, Vec p)
    cpdef Vec imul(self, m)
    cpdef Vec idiv(self, double m)
    cpdef double getitem(Vec self,int i)
    cpdef setitem(Vec self,int i,double val)
    cpdef add_inplace(self, Vec p)
    cpdef set(self, double x, double y, double z)
    cpdef numpy.ndarray asarray(self)
    cpdef double norm(self)
    cpdef double length(self)
    cpdef double dot(self, Vec p)
    cpdef Vec cross(self, Vec p)
    cpdef double distance(self, Vec p)

cpdef inline Vec Vec_new(double x=*, double y=*, double z=*)
cdef inline Vec Vec_sub(Vec pa, Vec pb)
cdef inline Vec Vec_add(Vec pa, Vec pb)
cdef inline double Vec_length(Vec p)
cdef inline double Vec_length2(Vec p)
cdef inline double Vec_distance(Vec pa, Vec pb)
cdef inline double Vec_distance2(Vec pa, Vec pb)
